package com.lab;

import java.io.Serializable;
import java.util.Date;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.apache.commons.lang.time.DateFormatUtils;

public class Employee extends Person implements Serializable {

	private static final long serialVersionUID = 1L;

	private Date dateJoined;
	private String grade;
	private Double salary;

	public Employee() {}

	public Employee(String name, Integer age, Date dateJoined, String grade,
			Double salary) {
		this.name = name;
		this.age = age;
		this.dateJoined = dateJoined;
		this.grade = grade;
		this.salary = salary;
	}

	@Override
	public String getName() {
		return name;
	}

	@Override
	public void setName(String name) {
		this.name = name;
	}

	@Override
	public Integer getAge() {
		return age;
	}

	@Override
	public void setAge(Integer age) {
		this.age = age;
	}

	public Date getDateJoined() {
		return dateJoined;
	}

	public void setDateJoined(Date dateJoined) {
		this.dateJoined = dateJoined;
	}

	public String getGrade() {
		return grade;
	}

	public void setGrade(String grade) {
		this.grade = grade;
	}

	public Double getSalary() {
		return salary;
	}

	public void setSalary(Double salary) {
		this.salary = salary;
	}

	@Override
	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
				.append("name", name).append("age", age).append("dateJoined",
						DateFormatUtils.format(dateJoined, "yyyy-MM-dd"))
				.append("grade", grade).append("salary", salary).toString();
	}

}
